package tec;


public class LancerTests {
  public static void main(String... args) throws Exception{
    boolean estMisAssertion = false;
    assert estMisAssertion = true;
    

     if (!estMisAssertion) {
      System.out.println("Execution impossible sans l'option -ea");
      return;
    }
     
    Class TestJaugeNaturel = Class.forName("tec.TestJaugeNaturel");
    Class TestAutobus = Class.forName("tec.TestAutobus");
    Class TestEtatPassager = Class.forName("tec.TestEtatPassager");
    Class TestPassagerStandard = Class.forName("tec.TestPassagerStandard");
    
     lancer(TestJaugeNaturel);
     lancer(TestAutobus);
     lancer(TestEtatPassager);
     lancer(TestPassagerStandard);
  }
    static private void lancer(Class c) throws Exception {

	int i;
	String s;
	Object arg[]=null;
	int nbTest = 0;
	java.lang.reflect.Method[] m = c.getMethods();
	
	for(i=0;i<m.length;i++){

	    s = m[i].getName();
	    if(s.startsWith("test")){
		m[i].invoke(c.newInstance(),arg);
		System.out.println(s+" Success"); nbTest++;
	    }
	}
	System.out.println("(" + nbTest + "):OK: " + c.getName()); 
    }

}
